import React, { Component } from 'react';
import {Switch, Redirect} from 'react-router-dom'
import PrivateRoute from '../PrivateRoute/index'
import couponRouter from '../../routers/coupon'// 优惠券管理
import activityRouter from '../../routers/activity'// 活动管理

const myRouters = [...couponRouter,...activityRouter];

class Main extends Component {
    render() {
        return (
                <Switch>
                    {
                        myRouters.map((item,index)=>{
                            return <PrivateRoute key={index} exact path={item.path} component={item.components} />
                        })
                    }
                    <Redirect path="/" to="/couponManage/coupon" />
                </Switch>
            )
    }
}
export default Main;